package com.hegongda.servlet;

import com.hegongda.service.ECharService;
import com.hegongda.utils.BeanFactory;
import net.sf.json.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(value = "/eCharServlet")
public class ECharServlet extends BaseServlet {
    ECharService es = BeanFactory.newInstance(ECharService.class);
    public void getEChar(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        double[][] doubles = es.fundThisYear();
        Result result = new Result(Result.SUCCESS, "", doubles);
        String s = JSONObject.fromObject(result).toString();
        response.getWriter().print(s);
    }
}
